package com.jrx.anytxn.customer.service;

import com.jrx.anytxn.common.exception.TxnBizException;
import com.jrx.anytxn.customer.dto.customer.CustomerLabelReq;
import com.jrx.anytxn.customer.dto.customer.CustomerLabelRes;
import com.jrx.anytxn.customer.entity.CmCustomerLabel;
import com.jrx.anytxn.number.exception.SegmentException;
import com.jrx.anytxn.param.entity.TlCustomerLabelLog;

import java.util.Date;
import java.util.List;

/**
 * 客户标签信息接口
 */
public interface ICustomerLabelService {

    /**
     * 生成客户标签信息
     * @param req
     * @return
     */
    CustomerLabelRes addCustomerLabel(CustomerLabelReq req) throws TxnBizException;

    /**
     * 获取客户的标签
     * @param tenantId
     * @param channel
     * @param customerId
     * @param businessDate
     * @return
     */
    public CmCustomerLabel matchingCustomerLabel(String tenantId, String channel, String customerId, Date businessDate);

    /**
     * 根据TlCustomerLabelLog生成CmCustomerLabel
     * @param labelLogList
     * @param customerId
     * @return
     * @throws TxnBizException
     */
    public List<CmCustomerLabel> buildCustomerLabel(List<TlCustomerLabelLog> labelLogList, String customerId) throws SegmentException;

    /**
     * 保存客户标签
     * @param customerLabelList
     */
    public void saveCustomerLabels(List<CmCustomerLabel> customerLabelList);
}
